package org.thanos.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;
import reactor.core.publisher.Mono;

import java.util.UUID;

@Slf4j
@Controller
public class DemoController {

    @MessageMapping("publish")
    public Mono<Void> publish(Integer value) {
        log.info("enter value is {}.", value);
        return Mono.empty();
    }

    @MessageMapping("demo")
    public Mono<String> demo(Integer value) {
        log.info("enter value is {}.", value);
        return Mono.just(UUID.randomUUID().toString());
    }
}
